<template>
	<view class="collect-all">
		<view class="collect-all-item">
			<template v-if="showProducts.length>0">
				
					<view  v-for="item in showProducts" :key="item.productId">
						<navigator class="collect-item" :url="'../../mall/productDetails/productDetails?productId='+item.productId" hover-class="none" hover-stop-propagation="true">
							<view class="collect-item-left">
								<image :src="item.productImage" mode=""></image>
							</view>
							<view class="collect-item-right">
								<view class="right-title">{{item.productDetail}}</view>
								<text>￥{{item.productPrice}}</text>
							</view>
						</navigator>
					</view>

			</template>
			<template v-if="showProducts.length<=0">
				<view>您未收藏商品，快去收藏您喜欢得商品吧~</view>
			</template>
		</view>
		<view class="collect-bottom">
			<selectedRecommendation></selectedRecommendation>
		</view>
	</view>
</template>

<script>
	import selectedRecommendation from "../../../components/selected-recommendation/selected-recommendation"
	export default {
		data() {
			return {
				showProducts:[]
			};
		},
		onLoad() {
			this.showProducts=uni.getStorageSync('showProduct')
			console.log(this.showProducts)
		},
		components:{
			selectedRecommendation
		}
	}
</script>

<style lang="scss" scoped>
	.collect-all{
		width: 100vw;
		height: 100vh;
		background-color: #f9f9f9;
		.collect-all-item{
			margin-top: 20rpx;
			.collect-item{
				width: 100%;
				height: 200rpx;
				display: flex;
				background-color: white;
				margin-top: 20rpx;
				.collect-item-left{
					width: 30%;
					height: 100%;
					image{
						width: 200rpx;
						height: 200rpx;
					}
				}
				.collect-item-right{
					width: 70%;
					height: 100%;
					.right-title{
						width: 100%;
						overflow: hidden;
						-webkit-line-clamp: 2;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-box-orient: vertical;
						margin-bottom: 20rpx;
					}
				}
			}
		}
		.collect-bottom{
			padding-left:40rpx ;
		}
	}
</style>
